3.182 \(\int \frac{\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx\)

Optimal. Leaf size=62 \[ \frac{4 \sin (c+d x)}{a^3 d}+\frac{4 i \cos (c+d x)}{a^3 d}+\frac{i \sec (c+d x)}{a^3 d}-\frac{3 \tanh ^{-1}(\sin (c+d x))}{a^3 d} \]

[Out]

(-3*ArcTanh[Sin[c + d*x]])/(a^3*d) + ((4*I)*Cos[c + d*x])/(a^3*d) + (I*Sec[c + d*x])/(a^3*d) + (4*Sin[c + d*x]
)/(a^3*d)

________________________________________________________________________________________

Rubi [A]  time = 0.161956, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 9, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.29, Rules used = {3092, 3090, 2637, 2638, 2592, 321, 206, 2590, 14} \[ \frac{4 \sin (c+d x)}{a^3 d}+\frac{4 i \cos (c+d x)}{a^3 d}+\frac{i \sec (c+d x)}{a^3 d}-\frac{3 \tanh ^{-1}(\sin (c+d x))}{a^3 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2/(a*Cos[c + d*x] + I*a*Sin[c + d*x])^3,x]

[Out]

(-3*ArcTanh[Sin[c + d*x]])/(a^3*d) + ((4*I)*Cos[c + d*x])/(a^3*d) + (I*Sec[c + d*x])/(a^3*d) + (4*Sin[c + d*x]
)/(a^3*d)

Rule 3092

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> Dist[a^n*b^n, Int[Cos[c + d*x]^m/(b*Cos[c + d*x] + a*Sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, m},
x] && EqQ[a^2 + b^2, 0] && ILtQ[n, 0]

Rule 3090

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Sym
bol] :> Int[ExpandTrig[cos[c + d*x]^m*(a*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] &&
 IntegerQ[m] && IGtQ[n, 0]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2592

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, (a*Sin[e + f*x])/ff
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2590

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> -Dist[f^(-1), Subst[Int[(1 - x^2
)^((m + n - 1)/2)/x^n, x], x, Cos[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n - 1)/2]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int \frac{\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx &=\frac{i \int \sec ^2(c+d x) (i a \cos (c+d x)+a \sin (c+d x))^3 \, dx}{a^6}\\ &=\frac{i \int \left (-i a^3 \cos (c+d x)-3 a^3 \sin (c+d x)+3 i a^3 \sin (c+d x) \tan (c+d x)+a^3 \sin (c+d x) \tan ^2(c+d x)\right ) \, dx}{a^6}\\ &=\frac{i \int \sin (c+d x) \tan ^2(c+d x) \, dx}{a^3}-\frac{(3 i) \int \sin (c+d x) \, dx}{a^3}+\frac{\int \cos (c+d x) \, dx}{a^3}-\frac{3 \int \sin (c+d x) \tan (c+d x) \, dx}{a^3}\\ &=\frac{3 i \cos (c+d x)}{a^3 d}+\frac{\sin (c+d x)}{a^3 d}-\frac{i \operatorname{Subst}\left (\int \frac{1-x^2}{x^2} \, dx,x,\cos (c+d x)\right )}{a^3 d}-\frac{3 \operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{a^3 d}\\ &=\frac{3 i \cos (c+d x)}{a^3 d}+\frac{4 \sin (c+d x)}{a^3 d}-\frac{i \operatorname{Subst}\left (\int \left (-1+\frac{1}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{a^3 d}-\frac{3 \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{a^3 d}\\ &=-\frac{3 \tanh ^{-1}(\sin (c+d x))}{a^3 d}+\frac{4 i \cos (c+d x)}{a^3 d}+\frac{i \sec (c+d x)}{a^3 d}+\frac{4 \sin (c+d x)}{a^3 d}\\ \end{align*}

Mathematica [A]  time = 0.314773, size = 109, normalized size = 1.76 \[ -\frac{i \sec ^3(c+d x) (\cos (d x)+i \sin (d x))^3 \left ((\tan (c+d x)-5 i) (\cos (2 c-d x)+i \sin (2 c-d x))+6 (\cos (3 c)+i \sin (3 c)) \tanh ^{-1}\left (\cos (c) \tan \left (\frac{d x}{2}\right )+\sin (c)\right )\right )}{a^3 d (\tan (c+d x)-i)^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2/(a*Cos[c + d*x] + I*a*Sin[c + d*x])^3,x]

[Out]

((-I)*Sec[c + d*x]^3*(Cos[d*x] + I*Sin[d*x])^3*(6*ArcTanh[Sin[c] + Cos[c]*Tan[(d*x)/2]]*(Cos[3*c] + I*Sin[3*c]
) + (Cos[2*c - d*x] + I*Sin[2*c - d*x])*(-5*I + Tan[c + d*x])))/(a^3*d*(-I + Tan[c + d*x])^3)

________________________________________________________________________________________

Maple [A]  time = 0.196, size = 108, normalized size = 1.7 \begin{align*} 8\,{\frac{1}{d{a}^{3} \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) }}+{\frac{i}{d{a}^{3}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) ^{-1}}-3\,{\frac{\ln \left ( \tan \left ( 1/2\,dx+c/2 \right ) +1 \right ) }{d{a}^{3}}}-{\frac{i}{d{a}^{3}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) ^{-1}}+3\,{\frac{\ln \left ( \tan \left ( 1/2\,dx+c/2 \right ) -1 \right ) }{d{a}^{3}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c))^3,x)

[Out]

8/d/a^3/(tan(1/2*d*x+1/2*c)-I)+I/d/a^3/(tan(1/2*d*x+1/2*c)+1)-3/d/a^3*ln(tan(1/2*d*x+1/2*c)+1)-I/d/a^3/(tan(1/
2*d*x+1/2*c)-1)+3/d/a^3*ln(tan(1/2*d*x+1/2*c)-1)

________________________________________________________________________________________

Maxima [B]  time = 1.6332, size = 444, normalized size = 7.16 \begin{align*} \frac{{\left (6 \, \cos \left (3 \, d x + 3 \, c\right ) + 6 \, \cos \left (d x + c\right ) + 6 i \, \sin \left (3 \, d x + 3 \, c\right ) + 6 i \, \sin \left (d x + c\right )\right )} \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) +{\left (6 \, \cos \left (3 \, d x + 3 \, c\right ) + 6 \, \cos \left (d x + c\right ) + 6 i \, \sin \left (3 \, d x + 3 \, c\right ) + 6 i \, \sin \left (d x + c\right )\right )} \arctan \left (\cos \left (d x + c\right ), -\sin \left (d x + c\right ) + 1\right ) -{\left (-3 i \, \cos \left (3 \, d x + 3 \, c\right ) - 3 i \, \cos \left (d x + c\right ) + 3 \, \sin \left (3 \, d x + 3 \, c\right ) + 3 \, \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right ) -{\left (3 i \, \cos \left (3 \, d x + 3 \, c\right ) + 3 i \, \cos \left (d x + c\right ) - 3 \, \sin \left (3 \, d x + 3 \, c\right ) - 3 \, \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) + 1\right ) + 12 \, \cos \left (2 \, d x + 2 \, c\right ) + 12 i \, \sin \left (2 \, d x + 2 \, c\right ) + 8}{{\left (-2 i \, a^{3} \cos \left (3 \, d x + 3 \, c\right ) - 2 i \, a^{3} \cos \left (d x + c\right ) + 2 \, a^{3} \sin \left (3 \, d x + 3 \, c\right ) + 2 \, a^{3} \sin \left (d x + c\right )\right )} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c))^3,x, algorithm="maxima")

[Out]

((6*cos(3*d*x + 3*c) + 6*cos(d*x + c) + 6*I*sin(3*d*x + 3*c) + 6*I*sin(d*x + c))*arctan2(cos(d*x + c), sin(d*x
 + c) + 1) + (6*cos(3*d*x + 3*c) + 6*cos(d*x + c) + 6*I*sin(3*d*x + 3*c) + 6*I*sin(d*x + c))*arctan2(cos(d*x +
 c), -sin(d*x + c) + 1) - (-3*I*cos(3*d*x + 3*c) - 3*I*cos(d*x + c) + 3*sin(3*d*x + 3*c) + 3*sin(d*x + c))*log
(cos(d*x + c)^2 + sin(d*x + c)^2 + 2*sin(d*x + c) + 1) - (3*I*cos(3*d*x + 3*c) + 3*I*cos(d*x + c) - 3*sin(3*d*
x + 3*c) - 3*sin(d*x + c))*log(cos(d*x + c)^2 + sin(d*x + c)^2 - 2*sin(d*x + c) + 1) + 12*cos(2*d*x + 2*c) + 1
2*I*sin(2*d*x + 2*c) + 8)/((-2*I*a^3*cos(3*d*x + 3*c) - 2*I*a^3*cos(d*x + c) + 2*a^3*sin(3*d*x + 3*c) + 2*a^3*
sin(d*x + c))*d)

________________________________________________________________________________________

Fricas [A]  time = 0.493061, size = 302, normalized size = 4.87 \begin{align*} -\frac{3 \,{\left (e^{\left (3 i \, d x + 3 i \, c\right )} + e^{\left (i \, d x + i \, c\right )}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 3 \,{\left (e^{\left (3 i \, d x + 3 i \, c\right )} + e^{\left (i \, d x + i \, c\right )}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 6 i \, e^{\left (2 i \, d x + 2 i \, c\right )} - 4 i}{a^{3} d e^{\left (3 i \, d x + 3 i \, c\right )} + a^{3} d e^{\left (i \, d x + i \, c\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c))^3,x, algorithm="fricas")

[Out]

-(3*(e^(3*I*d*x + 3*I*c) + e^(I*d*x + I*c))*log(e^(I*d*x + I*c) + I) - 3*(e^(3*I*d*x + 3*I*c) + e^(I*d*x + I*c
))*log(e^(I*d*x + I*c) - I) - 6*I*e^(2*I*d*x + 2*I*c) - 4*I)/(a^3*d*e^(3*I*d*x + 3*I*c) + a^3*d*e^(I*d*x + I*c
))

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2/(a*cos(d*x+c)+I*a*sin(d*x+c))**3,x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [A]  time = 1.20389, size = 151, normalized size = 2.44 \begin{align*} -\frac{\frac{3 \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right )}{a^{3}} - \frac{3 \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right )}{a^{3}} - \frac{2 \,{\left (4 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - i \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 5\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - i \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right )} a^{3}}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c))^3,x, algorithm="giac")

[Out]

-(3*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a^3 - 3*log(abs(tan(1/2*d*x + 1/2*c) - 1))/a^3 - 2*(4*tan(1/2*d*x + 1/2
*c)^2 - I*tan(1/2*d*x + 1/2*c) - 5)/((tan(1/2*d*x + 1/2*c)^3 - I*tan(1/2*d*x + 1/2*c)^2 - tan(1/2*d*x + 1/2*c)
 + I)*a^3))/d